package mmc.server.shell.ops.utility;

import java.util.Collection;

import mmc.cell.ServerCell;
import mmc.server.Server;
import mmc.server.shell.ShellException;
import mmc.server.shell.ops.Function;

public class FlagCellsDirty extends Function {

    public FlagCellsDirty(String text) throws ShellException {
        super(text, "flagcellsdirty", 0, true);
    }

	@Override
    public double execute() {
		Collection<ServerCell> allCells = Server.instance.getScene().getCellManager().debug_getAllCells();
		Server.instance.getScene().markCellsAsDirty(allCells);
		Server.instance.getCellProvider().getCellStorage().markCellsAsDirty(allCells);
    	return 0;
    }
    
    public static String getDescription(){
    	return formatHelpString("flagCellsDirty()","forces all cells to be retransmitted to clients");
    }

}
